package org.apache.solr.spelling;

import org.apache.solr.common.util.NamedList;

public class SpellCheckCollation implements Comparable<SpellCheckCollation> {

    private NamedList<String> misspellingsAndCorrections;
    private int hits;
    private int internalRank;
    private String collationQuery;

    @Override
    public int compareTo(SpellCheckCollation scc) {

        int c = new Integer(internalRank).compareTo(scc.internalRank);
        if (c == 0) {
            return collationQuery.compareTo(scc.collationQuery);
        }
        return c;
    }

    public NamedList<String> getMisspellingsAndCorrections() {
        return misspellingsAndCorrections;
    }

    public void setMisspellingsAndCorrections(NamedList<String> misspellingsAndCorrections) {
        this.misspellingsAndCorrections = misspellingsAndCorrections;
    }

    public int getHits() {
        return hits;
    }

    public void setHits(int hits) {
        this.hits = hits;
    }

    public String getCollationQuery() {
        return collationQuery;
    }

    public void setCollationQuery(String collationQuery) {
        this.collationQuery = collationQuery;
    }

    public int getInternalRank() {
        return internalRank;
    }

    public void setInternalRank(int internalRank) {
        this.internalRank = internalRank;
    }
}
